home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / python2.4 / test / test_codecmaps_jp.pyc (.txt) < prev    next >
Python Compiled Bytecode  |  2005-10-18  |  3KB  |  66 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.4)
  3.  
  4. from test import test_support
  5. from test import test_multibytecodec_support
  6. import unittest
  7.  
  8. class TestCP932Map(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase):
  9.     encoding = 'cp932'
  10.     mapfilename = 'CP932.TXT'
  11.     mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP932.TXT'
  12.     supmaps = [
  13.         ('\x80', u'\xc2\x80'),
  14.         ('\xa0', u'\xef\xa3\xb0'),
  15.         ('\xfd', u'\xef\xa3\xb1'),
  16.         ('\xfe', u'\xef\xa3\xb2'),
  17.         ('\xff', u'\xef\xa3\xb3')]
  18.     for i in range(161, 224):
  19.         supmaps.append((chr(i), unichr(i + 65216)))
  20.     
  21.  
  22.  
  23. class TestEUCJPCOMPATMap(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase):
  24.     encoding = 'euc_jp'
  25.     mapfilename = 'EUC-JP.TXT'
  26.     mapfileurl = 'http://people.freebsd.org/~perky/i18n/EUC-JP.TXT'
  27.  
  28.  
  29. class TestSJISCOMPATMap(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase):
  30.     encoding = 'shift_jis'
  31.     mapfilename = 'SHIFTJIS.TXT'
  32.     mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/SHIFTJIS.TXT'
  33.     pass_enctest = [
  34.         ('\x81_', u'\\')]
  35.     pass_dectest = [
  36.         ('\\', u'\xc2\xa5'),
  37.         ('~', u'\xe2\x80\xbe'),
  38.         ('\x81_', u'\\')]
  39.  
  40.  
  41. class TestEUCJISX0213Map(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase):
  42.     encoding = 'euc_jisx0213'
  43.     mapfilename = 'EUC-JISX0213.TXT'
  44.     mapfileurl = 'http://people.freebsd.org/~perky/i18n/EUC-JISX0213.TXT'
  45.  
  46.  
  47. class TestSJISX0213Map(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase):
  48.     encoding = 'shift_jisx0213'
  49.     mapfilename = 'SHIFT_JISX0213.TXT'
  50.     mapfileurl = 'http://people.freebsd.org/~perky/i18n/SHIFT_JISX0213.TXT'
  51.  
  52.  
  53. def test_main():
  54.     suite = unittest.TestSuite()
  55.     suite.addTest(unittest.makeSuite(TestCP932Map))
  56.     suite.addTest(unittest.makeSuite(TestEUCJPCOMPATMap))
  57.     suite.addTest(unittest.makeSuite(TestSJISCOMPATMap))
  58.     suite.addTest(unittest.makeSuite(TestEUCJISX0213Map))
  59.     suite.addTest(unittest.makeSuite(TestSJISX0213Map))
  60.     test_support.run_suite(suite)
  61.  
  62. test_multibytecodec_support.register_skip_expected(TestCP932Map, TestEUCJPCOMPATMap, TestSJISCOMPATMap, TestEUCJISX0213Map, TestSJISX0213Map)
  63. if __name__ == '__main__':
  64.     test_main()
  65.  
  66.